Skip to content

Reuse parameter signatures when preparing ref copyback - #671

Open
jogibear9988 wants to merge 1 commit into
dadhi:masterfrom
jogibear9988:fix/reuse-copyback-signatures-20261114
Open

jogibear9988 wants to merge 1 commit into
dadhi:masterfrom
jogibear9988:fix/reuse-copyback-signatures-20261114

Conversation

@jogibear9988

Copy link
Copy Markdown
Contributor

Methods, constructors and delegate invocations already obtain their parameter signatures before selecting the copyback path. Pass those arrays into the prepared-call helper instead of obtaining a second copy.

Existing ref-copyback suites cover all three entry paths, typed temporaries, aliases and failure behavior. No emitted-code change is intended.

Validation

Full Release solution build and Standard/LightExpression native runners pass for net8.0, net10.0 and net472. net8.0: 684 TestX and 1744 legacy cases; net10.0: 684 TestX and 1745 legacy cases; net472: 665 TestX and 1610 legacy cases.

Measurements

FEC on master da14580f10fd19ae2361a8e91cfad4b2dfec182a → this change 20f4f782eadb2cef8357d974e70e03428058297c. Windows ARM64; .NET 8.0.28 and 10.0.9; SDK 10.0.301.

Trees, API conversions and invocation adapters are built before measurement. Compilation includes delegate creation; runtime measures the compiled delegate through the same adapter. Both sides are FEC: “System trees” names the expression API, not the System compiler.

Two opposite-load-order process rounds; seven alternating paired samples per round; medians of 14 samples, 100 ms calibration target. Verified task-local runtimes; tiered compilation disabled; each process pinned to one logical CPU. Allocations use GC.GetAllocatedBytesForCurrentThread. Slower observations are retained. Timing variation, including unchanged IL controls, prevents a blanket speedup or no-regression claim.

Runtime / API Workload Compile μs, master → patch Compile B/op Runtime ns, master → patch Runtime B/op
net10.0 / LightExpression ref_property_call 5.290 → 3.235 1136.0 → 1104.0 4.147 → 4.428 0.0
net10.0 / LightExpression ref_property_ctor 4.442 → 5.539 1152.0 → 1120.0 10.662 → 9.401 24.0
net10.0 / LightExpression ref_property_invoke 6.641 → 7.032 1280.0 → 1248.0 6.153 → 6.262 0.0
net10.0 / LightExpression scalar_add 3.415 → 4.520 872.0 4.679 → 5.669 0.0
net10.0 / System trees ref_property_call 7.127 → 6.813 1136.1 → 1104.1 5.564 → 4.045 0.0
net10.0 / System trees ref_property_ctor 6.681 → 4.904 1152.1 → 1120.1 19.005 → 10.801 24.0
net10.0 / System trees ref_property_invoke 13.251 → 9.362 1280.1 → 1248.1 9.264 → 8.553 0.0
net10.0 / System trees scalar_add 3.344 → 3.329 872.0 3.626 → 4.850 0.0
net8.0 / LightExpression ref_property_call 9.105 → 13.772 1136.0 → 1104.0 5.660 → 3.297 0.0
net8.0 / LightExpression ref_property_ctor 12.422 → 7.313 1152.0 → 1120.0 12.441 → 14.597 24.0
net8.0 / LightExpression ref_property_invoke 8.759 → 13.798 1280.0 → 1248.0 10.202 → 7.895 0.0
net8.0 / LightExpression scalar_add 8.658 → 6.143 872.0 4.705 → 6.632 0.0
net8.0 / System trees ref_property_call 13.976 → 15.841 1136.2 → 1104.2 9.754 → 9.349 0.0
net8.0 / System trees ref_property_ctor 15.853 → 15.350 1152.2 → 1120.2 14.980 → 15.837 24.0
net8.0 / System trees ref_property_invoke 19.312 → 18.982 1280.2 → 1248.2 12.009 → 10.647 0.0
net8.0 / System trees scalar_add 8.994 → 8.554 872.0 4.783 → 6.739 0.0

Shared-workload emitted IL is unchanged.

Allocation changes: ref_property_call/compile: -32 B/op in both APIs on both runtimes; ref_property_ctor/compile: -32 B/op in both APIs on both runtimes; ref_property_invoke/compile: -32 B/op in both APIs on both runtimes.

Methods, constructors and delegate invocations already obtain their parameter signatures before selecting the copyback path. Pass those arrays into the prepared-call helper instead of obtaining a second copy.

Existing ref-copyback suites cover all three entry paths, typed temporaries, aliases and failure behavior. No emitted-code change is intended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant